﻿#region 信息

// Copyright©2014 Rex Rao all rights reserved.
// File name : SoMcCoffee\Sohobloo.SoMcCoffee\EntityBase.cs
// Author : Sohobloo
// Create time : 2014/01/31 23:40
// Update time : 2014/02/05 8:57

#endregion

#region 引用

using System;

#endregion

namespace Sohobloo.SoMcCoffee.Entity
{
    public enum DataStatus
    {
        Normal = 0,
        System = 1,
        ReadOnly = 2,
        Disabled = 3,
        Deleted = 4
    }

    [Serializable]
    public abstract class EntityBase
    {
        #region 属性

        public Guid Id { get; set; }

        public string CreateUser { get; set; }

        public DateTime CreateTime { get; set; }

        public DateTime UpdateTime { get; set; }

        public string UpdateUser { get; set; }

        public byte[] Timestamp { get; set; }

        public DataStatus DataStatus { get; set; }

        public long SortIndex { get; set; }

        public virtual bool EnableSort { get { return false; } }

        #endregion 属性

        #region 构造

        protected EntityBase()
        {
            Id = Guid.NewGuid();
            CreateUser = UpdateUser = string.Empty;
            DataStatus = DataStatus.Normal;
        }

        #endregion 构造
    }
}